<?php /*
	
*/ ?>
<?php include("system/config.inc.php");
$donotinclude = 1;
if(!isset($_SESSION['memberid']) && !isset($_SESSION['custid'])!="") {
	header("location:customerlogin.php");
	die();
}
// check customer basket is empty or not
if(isset($_SESSION['memberid']) && trim($_SESSION['memberid']!="")) {
	$id = $_SESSION['memberid'];
	$sqlbask="select * from tblcustomerbaskets where intcustomerid='$id'";
	$resbask=$n02586916_db->select($sqlbask);
	if(count($resbask)==0) {
		header("location:customerlogin.php");
		die();
	}
} else if(isset($_SESSION['custid']) && ($_SESSION['custid'])!="") {
	$id= $_SESSION['custid'];
	$sqlbask="select * from tblcustomerbaskets where intcustomerid='$id'";
	$resbask=$n02586916_db->select($sqlbask);
	if(count($resbask)==0) {
		header("location:customerlogin.php");
		die();
	}
}
if(isset($_SESSION['memberid']) && ($_SESSION['memberid'])!="") {
	$userid=$_SESSION['memberid'];
} else if(isset($_SESSION['custid']) && ($_SESSION['custid'])!="") {
	$userid= $_SESSION['custid'];
}
$session=session_id();
		$sql4 = "UPDATE `tblcustomerbaskets` SET `intcustomerid` = '$userid' WHERE `varsessionid`='$session'";
		$n02586916_db->edit($sql4);
?>
<?php include("inc/head.inc.php");?>
<body>
<form name="editship" action="" method="post">
<table width="824" border="0" cellpadding="0" cellspacing="0"  align="center">
  
  <tr>
    <td class="headerclass"><?php include(INC."top.inc.php") ?></td>
  </tr>
  <tr>
    <td valign="top" class="maincontainer"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr><td valign="top"class="leftmenuback"><?php include(INC."left.inc.php") ?></td>
        <td valign="top">
		<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="100%" height="23" class="head"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
			
		   <td style="width:1px;"></td>
		   <td height="22" bgcolor="#000000" class="style1" style="padding-left:14px;">
		    Personal Details
		   </td>
		   <td style="width:1px;"></td>
		   </tr>
          </table></td>
        </tr>
		<tr>
		  <td height="23" align="right" valign="middle" class="staus"><img src="images/back.gif" width="60" height="19" border="0" onClick="history.go(-1);"/>&nbsp;&nbsp;</td>
		  </tr>
		<tr>
          <td height="23" valign="middle" class="font">&nbsp; <span class="price">&nbsp;1&nbsp;&nbsp;confirm</span> | <span class="font">&nbsp;2&nbsp;&nbsp;postage</span> | <span class="font">&nbsp;3&nbsp;&nbsp;pay</span> | <span class="font">&nbsp;5&nbsp;&nbsp;Discount Codes</span> | <span class="font">&nbsp;5&nbsp;&nbsp;Order Confirmation</span></td>
	    </tr>
        <tr>
          <td align="center" class="aabold">
		  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="proborder">
            <tr>
              <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
			
		   <td style="width:1px;"></td>
		   <td height="22" bgcolor="#000000" class="style1" style="padding-left:14px;"><span class="prborderbg">Personal Details &amp; Shipping Address </span></td>
		   <td style="width:1px;"></td>
		   </tr>
          </table></td>
              </tr>
            <tr>
              <td colspan="2" class="font" style="padding-top:5px;">Please choose from your address book where you would like the items to be   delivered to.</td>
              </tr>
            <tr>
              <td width="71%" valign="bottom" class="search" style="padding-top:5px;" align="left"><strong>Personal Detail</strong> <br /></td>
              <td width="29%" valign="top" class="fontsmall" style="padding-top:5px;" align="left"><strong class="search">Shipping Address</strong></td>
            </tr>
            <tr>
              <td rowspan="2" class="addressfont">
			  
			  <?php 
			  	if(isset($_SESSION['memberid']) && ($_SESSION['memberid'])!="")
				{
						$memid =  $_SESSION['memberid'];
						$sql123 = "select * from tblcustomers where intcusid ='$memid'";
						$result = $n02586916_db->select($sql123);
						if($result)
						{
							$email1 = $result[0]['varcustemail'];
							$fname1 = $result[0]['varcustfname'];
							$lname1 = $result[0]['varcustlname'];
							$birthdate1 = $result[0]['dtdob'];
							$sex = $result[0]['charcustsex'];
							echo "E-Mail: ".$email1."<br>".
							"First Name: ".$fname1."<br>".
							"Last Name: ".$lname1."<br>".
							"Birth Date: ".$birthdate1."<br>";
						}
				}		
			  ?>			 	  </td>
              <?php 
			if(isset($_SESSION['memberid']) && ($_SESSION['memberid'])!="")	{
				$custid=$_SESSION['memberid'];
			} else if(isset($_SESSION['custid']) && ($_SESSION['custid'])!="") {
				$custid= $_SESSION['custid'];
			}
			$sql="select * from tblcustomeradd where intcustomerid='$custid'";
			$res=$n02586916_db->select($sql);
			if($res)
			{
			$deliveryaddress = $res[0]['vardeliverystreetaddress'];
		?>
              <td class="addressfont"><?php echo 
			   stripslashes($res[0]['vardeliverystreetaddress'])."<br />".
			   stripslashes($res[0]['vardeliverycity'])."<br />".
			   stripslashes($res[0]['vardeliverypostcode'])."<br />".
			   stripslashes($res[0]['vardeliverystate'])."<br />".
			   stripslashes($res[0]['vardeliverycountry']); ?></td>
			    <?php }?>
			</tr>
            <tr>
              <td rowspan="2" align="left"><a href="checkoutshiping.php" class="aa">Change Address</a></td>
            </tr>
            <tr>
              <td align="left"><a href="changeaccountinfo.php" class="aa">Change Your Personal Details</a> </td>
              </tr>
           
          </table>
		  <br />
		  <table width="100%" border="0" cellpadding="0" cellspacing="2" class="proborder">
            <tr>
              <td height="23" colspan="2" bgcolor="#000000" class="style1">&nbsp;Billing Address </td>
            </tr>
            <tr>
              <td colspan="2" class="font">Please choose from your address book where you would like the items to be delivered to.</td>
              </tr>
            <tr>
              <td width="71%" class="fontsmall"><br /></td>
              <td width="29%" valign="top" class="fontsmall" align="left"><strong class="search">Billing Address </strong></td>
            </tr>
            <tr>
              <td rowspan="2" class="addressfont" align="left"></td>
              <?php 
			if(isset($_SESSION['memberid']) && ($_SESSION['memberid'])!="")
			{
			$custid=$_SESSION['memberid'];
			//echo $custid;
			}
			else if(isset($_SESSION['custid']) && ($_SESSION['custid'])!="")
			{
			$custid= $_SESSION['custid'];
			}
			$sql="select * from tblcustomeradd where intcustomerid='$custid'";
			$res=$n02586916_db->select($sql);
			if($res)
			{
			$billingaddress = $res[0]['varbillingstreetaddress'];
			?>
              <td class="addressfont" align="left"><?php echo 
			   stripslashes($res[0]['varbillingstreetaddress'])."<br />".
			   stripslashes($res[0]['varbillingcity'])."<br />".
			   stripslashes($res[0]['varbillingpostcode'])."<br />".
			   stripslashes($res[0]['varbillingstate'])."<br />". 
			   stripslashes($res[0]['varbillingcountry']);?></td>
			     <?php }?>
            </tr>
            <tr>
              <td class="fontsmall" align="left"><a href="checkoutshiping.php" class="aa">Change Address</a></td>
            </tr>
          </table>
		 <br /> 
		  <table width="100%" border="0" cellpadding="0" cellspacing="3" class="proborder">
      <tr>
        <td width="100%" align="center" class="font" colspan="2">
		<a href="checkoutshiping.php"><img src="images/continue.gif" border="0" style="cursor:hand;" /></a>&nbsp;&nbsp;
		</td>
      </tr>
    </table>		  </td>
        </tr> 
      </table>		</td>
      </tr>
    </table>
    </td>
  </tr>
  <tr>
    <td><?php include "inc/bottom.inc.php"; ?></td>
  </tr>
</table>
</form>
</body>
</html>
